package net.esj.basic.core.engine.support.validator.exception;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;

public class ValidateMessage extends LinkedHashMap implements Map{


	private int cursor = 0;
	private int size = 0;

	public ValidateMessage(int size) {
		super(size);
	}
	
	public void add(Entry entry){
		put(entry.getKey(), entry.getValue());
	}

	/**
	 * 
	 * @param splitStr 分隔符
	 * @return
	 */
	public String getMessage(String splitStr) {
		StringBuilder sb = new StringBuilder();
		for(Object o : values()){
			if(o!=null){
				sb.append(o.toString()).append(splitStr);
			}
		}
		return sb.substring(0, sb.length()-splitStr.length());
	}

}
